﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UFIDA.U9.AP.Enums;
using UFIDA.U9.CBO.FI.Enums;
using UFIDA.U9.CBO.SCM.Item;
using UFIDA.U9.PM.PO;
using UFSoft.UBF.Business;
using UFSoft.UBF.Eventing;
using UFSoft.UBF.Util.DataAccess;

namespace UFIDA.U9.CusDev.QJKJPlugInBE
{
    class ProcessForXJFKDtoMemo : IEventSubscriber
    {
        public void Notify(params object[] args)
        {

            if (args == null || args.Length == 0 || !(args[0] is UFSoft.UBF.Business.EntityEvent)) return;
            BusinessEntity.EntityKey key = ((UFSoft.UBF.Business.EntityEvent)args[0]).EntityKey;

            if (key == null || key.GetEntity() == null) return;
            //现金银行付款单
            UFIDA.U9.CM.CMBill.PayBill.CMPayBill cMPayBill = key.GetEntity() as UFIDA.U9.CM.CMBill.PayBill.CMPayBill;
            if (cMPayBill == null) return;

            #region 现金银行付款单保存时,
            if (cMPayBill.Supplier.Supplier.Code == "02015")
            {
                cMPayBill.Memo = "报销";
                cMPayBill.Purpose = "报销";
            }
            else
            {
                cMPayBill.Memo = "货款";
                cMPayBill.Purpose = "货款";
            }

            





            #endregion

        }

    }
}
